home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
bc_ti
/
ti719.asc
< prev
next >
Wrap
Text File
|
1992-02-24
|
941b
|
67 lines
PRODUCT : Borland C++ NUMBER : 719
VERSION : 2.0
OS : DOS
DATE : February 25, 1992 PAGE : 1/1
TITLE : Getting the Size of a File
/***************************************************
This program shows how to get the size of a file.
***************************************************/
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
int main(void)
{
int handle;
char buf[11] = "0123456789";
/* create a file containing 10 bytes */
handle = open("DUMMY.FIL", O_CREAT);
write(handle, buf, strlen(buf));
/* display the size of the file */
printf("file length in bytes: %ld\n",
filelength(handle));
/* close the file */
close(handle);
return 0;
}